import { IResourceManager } from "../Resources/IResourceManager";
import {ISoundHelper} from "./ISoundHelper";
import { ISoundGroup } from "./ISoundGroup";
import { ISoundGroupHelper } from "./ISoundGroupHelper";
import {ISoundAgentHelper} from "./ISoundAgentHelper";
import { PlaySoundParams } from "./PlaySoundParams";

export interface ISoundManager {
    /// <summary>
    /// 获取声音组数量。
    /// </summary>
     SoundGroupCount:number;


/// <summary>
/// 播放声音成功事件。
/// </summary>
  PlaySoundSuccess;

/// <summary>
/// 播放声音失败事件。
/// </summary>
PlaySoundFailure;

/// <summary>
/// 播放声音更新事件。
/// </summary>
PlaySoundUpdate;

/// <summary>
/// 播放声音时加载依赖资源事件。
/// </summary>
PlaySoundDependencyAsset;

/// <summary>
/// 设置资源管理器。
/// </summary>
/// <param name="resourceManager">资源管理器。</param>
 SetResourceManager( resourceManager:IResourceManager):void;

/// <summary>
/// 设置声音辅助器。
/// </summary>
/// <param name="soundHelper">声音辅助器。</param>
 SetSoundHelper( soundHelper:ISoundHelper):void;

/// <summary>
/// 是否存在指定声音组。
/// </summary>
/// <param name="soundGroupName">声音组名称。</param>
/// <returns>指定声音组是否存在。</returns>
 HasSoundGroup( soundGroupName:string):boolean;

/// <summary>
/// 获取指定声音组。
/// </summary>
/// <param name="soundGroupName">声音组名称。</param>
/// <returns>要获取的声音组。</returns>
 GetSoundGroup( soundGroupName:string):ISoundGroup;

/// <summary>
/// 获取所有声音组。
/// </summary>
/// <returns>所有声音组。</returns>
 GetAllSoundGroups():ISoundGroup[];




/// <summary>
/// 增加声音组。
/// </summary>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="soundGroupAvoidBeingReplacedBySamePriority">声音组中的声音是否避免被同优先级声音替换。</param>
/// <param name="soundGroupMute">声音组是否静音。</param>
/// <param name="soundGroupVolume">声音组音量。</param>
/// <param name="soundGroupHelper">声音组辅助器。</param>
/// <returns>是否增加声音组成功。</returns>
AddSoundGroup(soundGroupName: string, soundGroupAvoidBeingReplacedBySamePriority:boolean, soundGroupHelper?: ISoundGroupHelper,soundGroupMute?: boolean, soundGroupVolume?: number):boolean;

/// <summary>
/// 增加声音代理辅助器。
/// </summary>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="soundAgentHelper">要增加的声音代理辅助器。</param>
 AddSoundAgentHelper( soundGroupName:string,  soundAgentHelper:ISoundAgentHelper):void;

/// <summary>
/// 获取所有正在加载声音的序列编号。
/// </summary>
/// <returns>所有正在加载声音的序列编号。</returns>
GetAllLoadingSoundSerialIds():number[];



/// <summary>
/// 是否正在加载声音。
/// </summary>
/// <param name="serialId">声音序列编号。</param>
/// <returns>是否正在加载声音。</returns>
 IsLoadingSound( serialId:number):boolean;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <returns>声音的序列编号。</returns>
 PlaySound( soundAssetName:string, soundGroupName:string):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="priority">加载声音资源的优先级。</param>
/// <returns>声音的序列编号。</returns>
 PlaySound(soundAssetName:string, soundGroupName:string, priority:number):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="playSoundParams">播放声音参数。</param>
/// <returns>声音的序列编号。</returns>
 PlaySound( soundAssetName:string,  soundGroupName:string,playSoundParams:PlaySoundParams):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="userData">用户自定义数据。</param>
/// <returns>声音的序列编号。</returns>
 PlaySound( soundAssetName:string,soundGroupName:string,userData?):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="priority">加载声音资源的优先级。</param>
/// <param name="playSoundParams">播放声音参数。</param>
/// <returns>声音的序列编号。</returns>
PlaySound( soundAssetName:string,soundGroupName:string,priority:number,playSoundParams:PlaySoundParams):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="priority">加载声音资源的优先级。</param>
/// <param name="userData">用户自定义数据。</param>
/// <returns>声音的序列编号。</returns>
PlaySound( soundAssetName:string,soundGroupName:string,priority:number,userData?):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="playSoundParams">播放声音参数。</param>
/// <param name="userData">用户自定义数据。</param>
/// <returns>声音的序列编号。</returns>
 PlaySound( soundAssetName:string,soundGroupName:string,playSoundParams:PlaySoundParams,userData?):number;

/// <summary>
/// 播放声音。
/// </summary>
/// <param name="soundAssetName">声音资源名称。</param>
/// <param name="soundGroupName">声音组名称。</param>
/// <param name="priority">加载声音资源的优先级。</param>
/// <param name="playSoundParams">播放声音参数。</param>
/// <param name="userData">用户自定义数据。</param>
/// <returns>声音的序列编号。</returns>
PlaySound(soundAssetName:string, soundGroupName:string,priority:number,playSoundParams:PlaySoundParams,userData?):number;

/// <summary>
/// 停止播放声音。
/// </summary>
/// <param name="serialId">要停止播放声音的序列编号。</param>
/// <returns>是否停止播放声音成功。</returns>
 StopSound( serialId:number):boolean;

/// <summary>
/// 停止播放声音。
/// </summary>
/// <param name="serialId">要停止播放声音的序列编号。</param>
/// <param name="fadeOutSeconds">声音淡出时间，以秒为单位。</param>
/// <returns>是否停止播放声音成功。</returns>
 StopSound( serialId:number,  fadeOutSeconds?:number):boolean;



/// <summary>
/// 停止所有已加载的声音。
/// </summary>
/// <param name="fadeOutSeconds">声音淡出时间，以秒为单位。</param>
 StopAllLoadedSounds(fadeOutSeconds?:number):void;

/// <summary>
/// 停止所有正在加载的声音。
/// </summary>
StopAllLoadingSounds():void;

/// <summary>
/// 暂停播放声音。
/// </summary>
/// <param name="serialId">要暂停播放声音的序列编号。</param>
 PauseSound(serialId:number):void;

/// <summary>
/// 暂停播放声音。
/// </summary>
/// <param name="serialId">要暂停播放声音的序列编号。</param>
/// <param name="fadeOutSeconds">声音淡出时间，以秒为单位。</param>
 PauseSound( serialId:number,  fadeOutSeconds?:number):void;

/// <summary>
/// 恢复播放声音。
/// </summary>
/// <param name="serialId">要恢复播放声音的序列编号。</param>
 ResumeSound( serialId:number):void;

/// <summary>
/// 恢复播放声音。
/// </summary>
/// <param name="serialId">要恢复播放声音的序列编号。</param>
/// <param name="fadeInSeconds">声音淡入时间，以秒为单位。</param>
 ResumeSound( serialId:number,  fadeInSeconds?:number):void;
}